//
//  TMPayResultCell.m
//  国学培训用户端
//
//  Created by Tao Li on 2018/7/18.
//  Copyright © 2018年 mac. All rights reserved.
//

#import "TMPayResultCell.h"
#import "TMMyCourseModel.h"
@implementation TMPayResultCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
-(void)setModel:(TMMyCartModel *)model{
    _model = model;
    self.orderNumber.text = [NSString stringWithFormat:@"订单号:%@",model.number];
    self.timeLabel.text = [NSString stringWithFormat:@"时间:%@",[SPToolSet stringFromDateString:model.end_time]];
    self.couresTitle.text = model.name;
    self.priceLabel.text = [NSString stringWithFormat:@"¥%.02f",model.price];
    [self.courseImage sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithBaseUrl:model.pic[0]]] placeholderImage:kPlaceholder];
    if (model.ret == 0) {
        [self.payBtn setTitle:@"支付成功" forState:UIControlStateNormal];
    }
    if (model.ret == 1) {
        [self.payBtn setTitle:@"退款中" forState:UIControlStateNormal];
    }
    if (model.ret == 2) {
        [self.payBtn setTitle:@"退款成功" forState:UIControlStateNormal];
    }

}
@end
